package com.rookie.tool.module.util.location;

import me.ihxq.projects.pna.Attribution;
import me.ihxq.projects.pna.PhoneNumberInfo;
import me.ihxq.projects.pna.PhoneNumberLookup;

/**
 * 获取手机号信息
 * @author rookie
 */
public class PhoneLocation {

    private static String getPhoneAttributionWithDatabase(String phone){
        PhoneNumberLookup phoneNumberLookup = new PhoneNumberLookup();
        return phoneNumberLookup.lookup(phone)
                .map(PhoneNumberInfo::getAttribution)
                .map(Attribution::getProvince)
                .orElse(null);
    }
}
